package io;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("image.png");
        FileOutputStream fos=new FileOutputStream("image2.png");
        int d;   //记录每次从原文件读取的字节
        long start= System.currentTimeMillis();  //起始时间
        while ((d=fis.read()) !=-1){
            fos.write(d);
        }
        long end=System.currentTimeMillis();
        System.out.println("复制完毕了"+(end-start)+"毫秒");
        fis.close();
        fos.close();
    }
}
